home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / abcslots / slots.frm < prev    next >
Text File  |  1995-05-08  |  7KB  |  287 lines

  1. VERSION 2.00
  2. Begin Form Main 
  3.    BackColor       =   &H00FFFF00&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "ABC Slots"
  6.    ClientHeight    =   3480
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1770
  9.    ClientWidth     =   6840
  10.    ControlBox      =   0   'False
  11.    ForeColor       =   &H000000FF&
  12.    Height          =   4170
  13.    Icon            =   SLOTS.FRX:0000
  14.    Left            =   1035
  15.    LinkMode        =   1  'Source
  16.    LinkTopic       =   "Form1"
  17.    ScaleHeight     =   3480
  18.    ScaleWidth      =   6840
  19.    Top             =   1140
  20.    Width           =   6960
  21.    Begin Timer Timer3 
  22.       Interval        =   40
  23.       Left            =   1440
  24.       Top             =   3480
  25.    End
  26.    Begin Timer Timer2 
  27.       Interval        =   40
  28.       Left            =   840
  29.       Top             =   3480
  30.    End
  31.    Begin Timer Timer1 
  32.       Interval        =   40
  33.       Left            =   240
  34.       Top             =   3480
  35.    End
  36.    Begin PictureBox Picture8 
  37.       Height          =   855
  38.       Left            =   4200
  39.       ScaleHeight     =   825
  40.       ScaleWidth      =   585
  41.       TabIndex        =   9
  42.       Top             =   3240
  43.       Visible         =   0   'False
  44.       Width           =   615
  45.    End
  46.    Begin PictureBox Picture7 
  47.       Height          =   855
  48.       Left            =   5760
  49.       ScaleHeight     =   825
  50.       ScaleWidth      =   585
  51.       TabIndex        =   8
  52.       Top             =   2280
  53.       Visible         =   0   'False
  54.       Width           =   615
  55.    End
  56.    Begin PictureBox Picture6 
  57.       Height          =   855
  58.       Left            =   4920
  59.       ScaleHeight     =   825
  60.       ScaleWidth      =   705
  61.       TabIndex        =   7
  62.       Top             =   2280
  63.       Visible         =   0   'False
  64.       Width           =   735
  65.    End
  66.    Begin PictureBox Picture5 
  67.       Height          =   855
  68.       Left            =   4200
  69.       ScaleHeight     =   825
  70.       ScaleWidth      =   585
  71.       TabIndex        =   6
  72.       Top             =   2280
  73.       Visible         =   0   'False
  74.       Width           =   615
  75.    End
  76.    Begin CommandButton Command2 
  77.       Caption         =   "Stop"
  78.       Height          =   495
  79.       Left            =   4560
  80.       TabIndex        =   2
  81.       Top             =   1440
  82.       Width           =   1815
  83.    End
  84.    Begin CommandButton Command1 
  85.       Caption         =   "Spin"
  86.       Height          =   615
  87.       Left            =   4560
  88.       TabIndex        =   1
  89.       Top             =   360
  90.       Width           =   1815
  91.    End
  92.    Begin PictureBox Picture1 
  93.       AutoSize        =   -1  'True
  94.       BackColor       =   &H00FFFF80&
  95.       BorderStyle     =   0  'None
  96.       ForeColor       =   &H0080FF80&
  97.       Height          =   3255
  98.       Left            =   120
  99.       Picture         =   SLOTS.FRX:0302
  100.       ScaleHeight     =   3255
  101.       ScaleWidth      =   3795
  102.       TabIndex        =   0
  103.       Top             =   120
  104.       Width           =   3795
  105.       Begin PictureBox Picture4 
  106.          Height          =   960
  107.          Left            =   2415
  108.          ScaleHeight     =   930
  109.          ScaleWidth      =   840
  110.          TabIndex        =   5
  111.          Top             =   705
  112.          Width           =   870
  113.       End
  114.       Begin PictureBox Picture3 
  115.          Height          =   960
  116.          Left            =   1440
  117.          ScaleHeight     =   930
  118.          ScaleWidth      =   840
  119.          TabIndex        =   4
  120.          Top             =   705
  121.          Width           =   870
  122.       End
  123.       Begin PictureBox Picture2 
  124.          Height          =   975
  125.          Left            =   465
  126.          ScaleHeight     =   945
  127.          ScaleWidth      =   825
  128.          TabIndex        =   3
  129.          Top             =   690
  130.          Width           =   855
  131.       End
  132.    End
  133.    Begin Menu Slots 
  134.       Caption         =   "ABC &Slots!"
  135.       Begin Menu About 
  136.          Caption         =   "&About!"
  137.       End
  138.       Begin Menu Outa 
  139.          Caption         =   "&Exit"
  140.       End
  141.    End
  142. End
  143. Sub About_Click ()
  144.  About1$ = "You have won" + Str$(TotalWins) + " time(s).  " + "You have lost" + Str$(TotalLoses) + " time(s)."
  145.  About2$ = About1$ + Chr$(13) + Chr$(13)
  146.  About1$ = "ABC Slots" + Chr$(13) + "A BMB Production!" + Chr$(13) + "Version 1.00B" + Chr$(13) + "12/21/91"
  147.  About2$ = About2$ + About1$
  148.  MsgBox About2$, 0, "ABC Slots"
  149.  
  150.  
  151.  
  152.  
  153. End Sub
  154.  
  155. Sub Command1_Click ()
  156.     Timer1.Enabled = True
  157. End Sub
  158.  
  159. Sub Command2_Click ()
  160.    If Count = 1 Then
  161.      Timer1.Enabled = False
  162.      Timer2.Enabled = True
  163.    End If
  164.    If Count = 2 Then
  165.      Timer2.Enabled = False
  166.      Timer3.Enabled = True
  167.    End If
  168.    If Count = 3 Then
  169.      Timer3.Enabled = False
  170.      If Win1 = 1 And Win2 = 1 And Win3 = 1 Then UserWin = True
  171.      If Win1 = 2 And Win2 = 2 And Win3 = 2 Then UserWin = True
  172.      If Win1 = 3 And Win2 = 3 And Win3 = 3 Then UserWin = True
  173.      If UserWin = True Then
  174.         MsgBox "You have won!", 64, "ABC Slots"
  175.         Picture2.Picture = Picture8.Picture
  176.         Picture3.Picture = Picture8.Picture
  177.         Picture4.Picture = Picture8.Picture
  178.         TotalWins = TotalWins + 1
  179.      End If
  180.      If UserWin = False Then
  181.         MsgBox "You lose!", 64, "ABC Slots"
  182.         Picture2.Picture = Picture8.Picture
  183.         Picture3.Picture = Picture8.Picture
  184.         Picture4.Picture = Picture8.Picture
  185.         TotalLoses = TotalLoses + 1
  186.      End If
  187.         UserWin = False
  188.     End If
  189.  
  190.  
  191.  
  192.  
  193. End Sub
  194.  
  195. Sub Form_Load ()
  196.    Count = 0
  197.    
  198.    TotalWins = 0
  199.    TotalLoses = 0
  200.                  
  201.    UserWin = False
  202.    Win1 = 0
  203.    Win2 = 0
  204.    Win3 = 0
  205.  
  206.    Timer1.Enabled = False
  207.    Timer2.Enabled = False
  208.    Timer3.Enabled = False
  209.  
  210.    Randomize Timer
  211.  
  212.  
  213.    Picture5.Picture = LoadPicture("Pic-A.BMP")
  214.    Picture6.Picture = LoadPicture("Pic-B.BMP")
  215.    Picture7.Picture = LoadPicture("Pic-C.BMP")
  216.  
  217. End Sub
  218.  
  219. Sub Options_Click ()
  220.   
  221.  
  222. End Sub
  223.  
  224. Sub Outa_Click ()
  225.    Bye$ = "You have won" + Str$(TotalWins) + " time(s).  " + "You have lost" + Str$(TotalLoses) + " time(s)."
  226.    MsgBox Bye$, 0, "ABC SlotS"
  227.  
  228.    End
  229. End Sub
  230.  
  231. Sub Timer1_Timer ()
  232.    Choose = Int(Rnd * 3)
  233.    If Choose = 0 Then
  234.      Picture2.Picture = Picture5.Picture
  235.      Win1 = 1
  236.    End If
  237.    If Choose = 1 Then
  238.      Picture2.Picture = Picture6.Picture
  239.      Win1 = 2
  240.    End If
  241.    If Choose = 2 Then
  242.      Picture2.Picture = Picture7.Picture
  243.      Win1 = 3
  244.    End If
  245.  
  246.    
  247.    Count = 1
  248.  
  249. End Sub
  250.  
  251. Sub Timer2_Timer ()
  252.    Choose = Int(Rnd * 3)
  253.    If Choose = 0 Then
  254.      Picture3.Picture = Picture5.Picture
  255.      Win2 = 1
  256.    End If
  257.    If Choose = 1 Then
  258.      Picture3.Picture = Picture6.Picture
  259.      Win2 = 2
  260.    End If
  261.    If Choose = 2 Then
  262.      Picture3.Picture = Picture7.Picture
  263.      Win2 = 3
  264.    End If
  265.    Count = 2
  266.  
  267. End Sub
  268.  
  269. Sub Timer3_Timer ()
  270.    Choose = Int(Rnd * 3)
  271.    If Choose = 0 Then
  272.      Picture4.Picture = Picture5.Picture
  273.      Win3 = 1
  274.    End If
  275.    If Choose = 1 Then
  276.      Picture4.Picture = Picture6.Picture
  277.      Win3 = 2
  278.    End If
  279.    If Choose = 2 Then
  280.      Picture4.Picture = Picture7.Picture
  281.      Win3 = 3
  282.    End If
  283.    Count = 3
  284.  
  285. End Sub
  286.  
  287.